<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .odd{color: red;}
    </style>
</head>
<body>
<h1>books</h1>
<table border="1">
    <tr>
        <td>计数</td>
        <td>图书编号</td>
        <td>图书名称</td>
        <td>图书作者</td>
        <td>图书日期</td>
        <td>操作</td>
    </tr>
    <tr th:each="book, bookStat:${bookList}" th:class="${bookStat.odd}?'odd'">
        <td th:text="${bookStat.count}"></td>
        <td th:text="${book.id}">图书ID</td>
        <td th:text="${book.name}">图书名称</td>
        <td th:text="${book.author}">图书作者</td>
        <td th:text="${#dates.format(book.date,'yyyy-MM-dd HH:mm:ss')}">2020-01-01</td>
        <td>
            <a th:href="@{'/books/' + ${book.id}}">详情</a>
            <a href="">删除</a>
        </td>
    </tr>
</table>
</body>
</html>